package edu.uwlax.cs.oayonlinestore.client.gui.shop;

import edu.uwlax.cs.oayonlinestore.client.Order;
import edu.uwlax.cs.oayonlinestore.client.User;
import edu.uwlax.cs.oayonlinestore.client.gui.Store;
import edu.uwlax.cs.oayonlinestore.client.gui.shared.ShippingForm;
import edu.uwlax.cs.oayonlinestore.client.utils.TitlePage;
import edu.uwlax.cs.oayonlinestore.vo.UserDetailsVO;

public class PageDeliver extends TitlePage {

	private ShippingForm form;

	protected void create() {
		setTitle("Delivery and Payment Information");
		UserDetailsVO u = User.get();
		add(form = new ShippingForm(u.isIsSalesManager() || u.isIsSalesStaff()));
		String confirm = Store.getFrame().getShopFrame().getConfirm()
				.getAnchor();
		form.addButton("Save and go to Confirmation", confirm);
	}

	public String getID() {
		return "Deliver";
	}

	protected void onShow() {
		form.loadData(Order.get().getId());
	}

}
